; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+experimental-b -verify-machineinstrs < %s \
; RUN:   | FileCheck %s -check-prefix=RV32B
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbc -verify-machineinstrs < %s \
; RUN:   | FileCheck %s -check-prefix=RV32BC

declare i32 @llvm.riscv.clmul.i32(i32 %a, i32 %b)

define i32 @clmul32(i32 %a, i32 %b) nounwind {
; RV32B-LABEL: clmul32:
; RV32B:       # %bb.0:
; RV32B-NEXT:    clmul a0, a0, a1
; RV32B-NEXT:    ret
;
; RV32BC-LABEL: clmul32:
; RV32BC:       # %bb.0:
; RV32BC-NEXT:    clmul a0, a0, a1
; RV32BC-NEXT:    ret
  %tmp = call i32 @llvm.riscv.clmul.i32(i32 %a, i32 %b)
 ret i32 %tmp
}

declare i32 @llvm.riscv.clmulh.i32(i32 %a, i32 %b)

define i32 @clmul32h(i32 %a, i32 %b) nounwind {
; RV32B-LABEL: clmul32h:
; RV32B:       # %bb.0:
; RV32B-NEXT:    clmulh a0, a0, a1
; RV32B-NEXT:    ret
;
; RV32BC-LABEL: clmul32h:
; RV32BC:       # %bb.0:
; RV32BC-NEXT:    clmulh a0, a0, a1
; RV32BC-NEXT:    ret
  %tmp = call i32 @llvm.riscv.clmulh.i32(i32 %a, i32 %b)
 ret i32 %tmp
}

declare i32 @llvm.riscv.clmulr.i32(i32 %a, i32 %b)

define i32 @clmul32r(i32 %a, i32 %b) nounwind {
; RV32B-LABEL: clmul32r:
; RV32B:       # %bb.0:
; RV32B-NEXT:    clmulr a0, a0, a1
; RV32B-NEXT:    ret
;
; RV32BC-LABEL: clmul32r:
; RV32BC:       # %bb.0:
; RV32BC-NEXT:    clmulr a0, a0, a1
; RV32BC-NEXT:    ret
  %tmp = call i32 @llvm.riscv.clmulr.i32(i32 %a, i32 %b)
 ret i32 %tmp
}
